"""
给定一个序列，找出其中最长的递增子序列
"""


def func_L(sequence, order_i):
    if order_i == len(sequence) - 1:
        return 1
    max_len = 1
    for num_j in range(order_i + 1, len(sequence)):
        if sequence[num_j] > sequence[order_i]:
            max_len = max(max_len, func_L(sequence, num_j) + 1)
            # max_len = func_L(sequence, num_j) + 1
    return max_len


if __name__ == "__main__":
    # nums = [1, 5, 2, 4, 3]
    nums = [1, 5]
    print(func_L(nums, 0))
